(function() {
  app.directive('iphonexAdaptation', function() {
    return {
      restrict: 'E',
      template: '<div ng-style="iphonex_adaptation_style"></div>',
      replace: true,
      scope: {},
      controller: function($scope, $state, getPhoneType, iphonex_footer) {
        if (getPhoneType.config.type === 'iphonex') {
          $scope.iphonex_adaptation_style = {
            width: '100%',
            height: '0.5rem',
            background: '#efefef',
            position: 'fixed',
            left: 0,
            bottom: 0
          };
          iphonex_footer.marginBottom = $scope.iphonex_adaptation_style.height;
        }
      },
      link: function(scope, ele, atr) {}
    };
  })
  app.factory('iphonex_footer', function() {
    return {
      marginBottom: '0'
    }
  });

})();